<?php
   //连接本地的 Redis 服务
   try {
      $redis = new Redis();
      $redis->connect('r-wz92f4beee3796f4.redis.rds.aliyuncs.com', 6379);
      echo "Connection to server sucessfully";
      $redis->auth('Yi2345liu');
      // 获取数据并输出
      $arList = $redis->keys("*");
      echo "Stored keys in redis:: ";
      print_r($arList);
   }catch(\Exception $e) {
      print_r($e);
   }